package com.yxy.system.domain.vo;

import com.yxy.common.annotation.Excel;
import lombok.*;

import java.math.BigDecimal;
import java.util.Date;

@Setter
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MonitorHostDto {

    private String code;

    private String address;

    private String name;

    private Long hostId;

    private String status;

    /** 主机类型 */
    private String types;

    /** 系统类型 */
    private String osType;

    /** 系统架构 */
    private String archType;

    private String remark;

    private int port;

    private String authType;

    private String agentVersion;

    private String agentInstallStatus;

    private String agentOnlineStatus;

    private Date agentOnlineChangeTime;

    private BigDecimal cpuUsage;

    private BigDecimal memoryUsage;

    private String diskJson;

    private String agentKey;

    /** 网络发送速率(KB/s) */
    @Excel(name = "网络发送速率(KB/s)")
    private BigDecimal networkSentRate;

    /** 网络接收速率(KB/s) */
    @Excel(name = "网络接收速率(KB/s)")
    private BigDecimal networkRecvRate;

    /**
     * 转为 base
     *
     * @return base
     */
    public MonitorHostDto toBase() {
        return MonitorHostDto.builder()
                .hostId(this.hostId)
                .types(this.types)
                .osType(this.osType)
                .archType(this.archType)
                .name(this.name)
                .code(this.code)
                .address(this.address)
                .port(this.port)
                .build();
    }
}
